package se.hrbustrc.hlgshopping.service;

import se.hrbustrc.hlgshopping.entity.Cart;
import com.baomidou.mybatisplus.extension.service.IService;
import se.hrbustrc.hlgshopping.utils.Result;
import se.hrbustrc.hlgshopping.controller.CartController.CartMergeRequest;

import java.util.List;

/**
* @author qianbimo
* @description 针对表【tb_cart(购物车表)】的数据库操作Service
* @createDate 2025-09-10 09:26:55
*/
public interface CartService extends IService<Cart> {
    boolean addCart(long skuId, int pnum, Long userId);
    Result cartList(long userId);
    boolean updateCartItemCount(long skuId, int newCount, Long userId);
    boolean deleteCartItems(List<Long> ids, Long userId);
    boolean mergeCart(List<Cart> cartItems, Long userId);
    boolean mergeCartFromFrontend(List<CartMergeRequest> cartItems, Long userId);
}
